package org.gten.gegedexin.service;

import org.apache.ibatis.annotations.Select;
import org.gten.gegedexin.dao.UserInfoDao;
import org.gten.gegedexin.pojo.UserInfoPojo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Eric
 * @date 2023/6/10
 */

@Service
public class UserInfoServiceImpl {
    @Autowired
    UserInfoDao userInfoDao;

    /**
     * 根据ID获取user_info
     * @param infoId ID
     * @return UserInfoDao对象
     */
    public UserInfoPojo getUserInfoById(String infoId){
        return userInfoDao.selectById(infoId);
    }
    /**
     * 添加user_info
     * @param username ID。添加User之后返回的ID值
     * @param profilePhoto 头像文件路径
     * @param profile 个人信息文件路径
     * @return
     */
    public void addUserInfo(String username, String profilePhoto, String profile){
        userInfoDao.insert(new UserInfoPojo(username, profilePhoto, profile));
    }
}
